<#include "/includes/vars.inc"> 
<#assign packageDir = project.@rootPackage?replace(".","/")>
<@pp.dropOutputFile />
<@pp.changeOutputFile name="${javaDir}${packageDir}/web/support/UtilControllerBase.java" />

package ${project.@rootPackage}.web.support;

import ${project.@rootPackage}.web.util.JsfUtil;
<#list enums.enum as enum>
import ${project.@rootPackage}.domain.enums.${enum.@name};
</#list> 
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Arrays;
import javax.faces.model.SelectItem;
import java.util.TimeZone;

/**
 * Util Controller class
 * <#if project.@author[0]??>@author ${project.@author}</#if>
 */
public abstract class UtilControllerBase {

	protected static final Logger logger = Logger.getLogger("UtilController");

    public UtilControllerBase() {
    }
    
    /*
    * It fix a jsf f:converDateTime bug  when the date conversion is done.
    */
    public TimeZone getTimeZone() {
        return TimeZone.getDefault();
    }

<#list enums.enum as enum>
    public SelectItem[] get${enum.@name}Items() {
        return JsfUtil.getEnumItems(Arrays.asList(${enum.@name}.values()), true);
    }
</#list>

 
}

